#ifndef __MYI2C_H
#define __MYI2C_H

#include "stm32f10x.h"             
#include "Delay.h"

/* 软件I2C */
#define MyI2C_GPIO_CLK_ENABLE()     RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE)

/* I2C引脚宏定义 */
#define MyI2C_SCL_GPIO              GPIOB
#define MyI2C_SCL_PIN               GPIO_Pin_6
#define MyI2C_SDA_GPIO              GPIOB
#define MyI2C_SDA_PIN               GPIO_Pin_7

/* I2C时序函数 */
void MyI2C_Init(void);
void MyI2C_Start(void);
void MyI2C_Stop(void);
void MyI2C_SendByte(uint8_t Byte);
uint8_t MyI2C_ReceiveByte(void);
void MyI2C_SendAck(uint8_t AckBit);
uint8_t MyI2C_ReceiveAck(void);

#endif
